const state = {
  userName: '',
  agencyId: '',
  token: '',
  userId: ''
}
const mutations = {
  SET_USER_NAME(state, name) {
    state.userName = name
  },
  SET_AGENCY_ID(state, agencyId) {
    state.agencyId = agencyId
  },

  SET_TOKEN(state, token) {
    state.token = token
  },

  SET_USERID(state, userId) {
    state.userId = userId
  }
}

const actions = {
  // 设置name
  setUserName({ commit }, name) {
    commit('SET_USER_NAME', name)
  },
  setAgencyId({ commit }, agencyId) {
    commit('SET_AGENCY_ID', agencyId)
  },

  setToken({ commit }, token) {
    commit('SET_TOKEN', token)
  },

  setUserId({ commit }, userId) {
    commit('SET_USERID', userId)
  }
}

export default {
  state,
  mutations,
  actions
}
